<template>
	<view>
		<view catchtouchmove="true" class="new-modal" v-if="show_attr_picker&&goods">
        <view class="new-modal-content">
            <image @tap="$emit('modalCloseGoods',$event)" :src="__wxapp_img.dapp.close3.url" style="position:absolute;right:0;top:0;width:72upx;height:72upx;"></image>
            <view class="new-modal-header text-more">{{goods.name}}</view>
            <view class="new-modal-body mb-24" style="min-height:0;padding:0 32upx;">
                <block v-for="(item,index) in attr_group_list" :key="item.id">
                    <view class="font-minor mb-20">{{item.attr_group_name}}</view>
                    <view class="flex-row" style="flex-wrap:wrap">
                        <view @tap="$emit('dappAttrClick',$event)" :class="['flex-grow-0 attr-item', value.checked?'active':'', value.attr_num_0?'attr_num_0':'']" :data-group-id="item.attr_group_id" :data-id="value.attr_id" v-for="(value,key) in item.attr_list" :key="value.id">{{value.attr_name}}</view>
                    </view>
                </block>
                <view class="flex-row flex-y-center bit pt-20">
                    <view class="flex-grow-1">购买数量</view>
                    <view class="flex-grow-0 attr-picker">
                        <view class="flex-row number-input-box">
                            <view @tap="$emit('numberSub',$event)" :class="['flex-grow-0 flex-x-center flex-y-center number-btn number-sub', form.number<=1?'disabled':'']" style="margin-right:0.01rem;">-
                            </view>
                            <view class="flex-grow-0">
                                <input @blur="$emit('numberBlur',$event)" class="flex-grow-1 number-input" min="1" step="1" style="padding:0" type="number" :value="form.number"></input>
                            </view>
                            <view @tap="$emit('numberAdd',$event)" class="flex-grow-0 flex-x-center flex-y-center number-btn number-add">+
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="new-modal-footer flex-row">
                <view class="flex-y-center flex-grow-1 pl-20 red">￥{{goods.price}}</view>
                <view @tap="$emit('modalConfirmGoods',$event)" class="flex-grow-0 flex-y-center pr-20">
                    <view class="goods-modal-btn">加入购物车</view>
                </view>
            </view>
        </view>
    </view>
	</view>
</template>

<script>var myVue = {};
	export default {
		props:['__wxapp_img','show_attr_picker','goods','attr_group_list','form'],
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>

</style>
